package mysql

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	UserId      int64  `gorm:"type:int;not null;comment:'用户编号'"`
	GoodsId     int64  `gorm:"type:int;not null;comment:'商品编号'"`
	GoodsTitle  string `gorm:"type:varchar(20);not null,comment:'商品名称'"`
	SynOrder    string `gorm:"type:char(36);not null;comment:'订单编号'"`
	OrderStatue int64  `gorm:"type:tinyint(1);not null;comment:'订单状态:0-未支付,1-已支付,2-未发货,3-已发货'"`
	OrderType   int64  `gorm:"type:tinyint(1);not null;comment:'支付样式:0-银行卡,1-支付宝,2-微信'"`
}

func (o *Order) Create() error {
	return DB.Create(&o).Error
}
